'use strict';

module.exports = () => {

  const apiConfig = {};
  const turl = 'http://pre-gw.api.taobao.com/top/router/rest';
  apiConfig.tjava = 'http://127.0.0.1:8077';
  // const turl = 'http://gw.api.taobao.com/router/rest';

  // 工单查询
  apiConfig.getOrders = {
    url: turl,
    method: 'tmall.servicecenter.tasks.search',
    // method: 'tmall.servicecenter.workcard.query',
  };

    // 单条工单查询
    apiConfig.getOrderById = {
      url: turl,
      method: 'tmall.servicecenter.task.get',
    };



    // 服务商接单
    apiConfig.receiveOrder = {
      url: turl,
      method: 'tmall.servicecenter.workcard.updatelogistics',
      param: {action:'accept'}
    };

    // 快递公司取件后
    apiConfig.expressPickUp = {
      url: turl,
      method: 'tmall.servicecenter.workcard.updatelogistics',
      param: {action:'send_to_supplier'}
    };

    // 服务商收货
    apiConfig.serviceBusinessReceive = {
      url: turl,
      method: 'tmall.servicecenter.workcard.updatelogistics',
      param: {action:'accept_goods'}
    };

    // 服务商更新厂内节点
    apiConfig.serviceBusinessUpdateNode = {
      url: turl,
      method: 'tmall.servicecenter.workcard.repairprogress.update',
    };

    // 服务商完成，等待寄出
    apiConfig.serviceBusinessWaitSend = {
      url: turl,
      method: 'tmall.servicecenter.workcard.updatelogistics',
      param: {action:'wait_sendback'}
    };

    // 服务商服务完成，已经寄出
    apiConfig.serviceBusinessSendOf = {
      url: turl,
      method: 'tmall.servicecenter.workcard.updatelogistics',
      param: {action:'send_back'}
    };

    // 服务商服务完成，等待消费者核销
    apiConfig.confirm = {
      url: turl,
      method: 'tmall.servicecenter.workcard.confirm',
    };

    // 图片上传接口
    apiConfig.upload = {
      url: turl,
      method: 'tmall.servicecenter.picture.upload',
    };

  return apiConfig;
};
